 <div>
                                <label>Following</label>
                                <?php

                                    echo '<div>';
                                            echo '<div  class="boxy2">';
                                    if (isset($_SESSION['username'])){
                                            $login = true;
                                    }
                                    else{
                                            $login = false;
                                    }
                                    $user = getUserNamePage();

                                    $con = mysql_connect("localhost", "progin", "progin");
                                    if (!$con)
                                            die('Could not connect: ' . mysql_error());

                                    mysql_select_db("progin", $con);

                                    $hasil = mysql_query("SELECT Username FROM follownet WHERE Follower = '$user' LIMIT 5 ", $con);
                                    $indeks = 0;
                                    $count = 0;
                                    if(mysql_num_rows($hasil)>0){
                                        while($baris = mysql_fetch_row($hasil)){
                                            if ($baris[8] == NULL){
                                                $gambar = 'images/bg-photo.png';
                                            }
                                            else{
                                                $idgambar = $baris[8];
                                                $hasil2 = mysql_query("SELECT * FROM Foto WHERE IDFOTO = $idgambar", $con);
                                                $baris2 = mysql_fetch_row($hasil2);
                                                $gambar = 'users/'.$baris2[1].'/'.$baris2[2];
                                            }
                                            $pemilik = $baris[0];
                                                echo '&nbsp';
                                                echo '<a title="'.$baris[3].'" href="profile.php?'.$pemilik.'"><img class="boxy2" src="'.$gambar.'" alt="fol_'.$indeks.'" width="50" height="50" name="foto_fol_'.$indeks.'" id="foto_fol_'.$indeks.'"/></a>';
                                            ++$indeks;
                                            ++$count;
                                        }
                                                echo '&nbsp';
                                            echo '</div>';
                                        if ($count == 0){
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>&nbsp';
                                        }
                                    }

                                    echo '</div>';
                                    if ($indeks > 4){
                                        echo '<a href="">See all...</a>';
                                    }
                                ?>
                                <br/>
                            </div>
                            <div>
                                <label>Follower</label>
                                <?php

                                    echo '<div>';
                                            echo '<div  class="boxy2">';
                                    if (isset($_SESSION['username'])){
                                            $login = true;
                                    }
                                    else{
                                            $login = false;
                                    }
                                    $user = getUserNamePage();

                                    $con = mysql_connect("localhost", "progin", "progin");
                                    if (!$con)
                                            die('Could not connect: ' . mysql_error());

                                    mysql_select_db("progin", $con);

                                    $hasil = mysql_query("SELECT Follower FROM follownet WHERE Username = '$user' LIMIT 5 ", $con);
                                    $indeks = 0;
                                    $count = 0;
                                    if(mysql_num_rows($hasil)>0){
                                        while($baris = mysql_fetch_row($hasil)){
                                            if ($baris[8] == NULL){
                                                $gambar = 'images/bg-photo.png';
                                            }
                                            else{
                                                $idgambar = $baris[8];
                                                $hasil2 = mysql_query("SELECT * FROM Foto WHERE IDFOTO = $idgambar", $con);
                                                $baris2 = mysql_fetch_row($hasil2);
                                                $gambar = 'users/'.$baris2[1].'/'.$baris2[2];
                                            }
                                            $pemilik = $baris[0];
                                                echo '&nbsp';
                                                echo '<a title="'.$baris[3].'" href="profile.php?'.$pemilik.'"><img class="boxy2" src="'.$gambar.'" alt="for_'.$indeks.'" width="50" height="50" name="foto_for_'.$indeks.'" id="foto_for_'.$indeks.'"/></a>';
                                            ++$indeks;
                                            ++$count;
                                        }
                                                echo '&nbsp';
                                            echo '</div>';
                                        if ($count == 0){
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>';
                                            echo '<br/>&nbsp';
                                        }
                                    }

                                    echo '</div>';
                                    if ($indeks > 4){
                                        echo '<a href="">See all...</a>';
                                    }
                                ?>
                            </div>
                            
                            
                            
                <div id="linkfromprofile">
                    <?php
                        if (isset($_SESSION['username'])){
                                $login = true;
                        }
                        else{
                                $login = false;
                        }
                        $user = getUserNamePage();
                        if ($login){
                            if ($user == $_SESSION['username']){
                                echo '<div>';
                                echo '    <a href="edit_profile.php?'.$user.'">Edit Profile</a>';
                                echo '</div>';
                            }
                        }
                        echo '<div>';
                            echo '<a href="wall.php?'.$user.'">Wall</a>';
                        echo '</div>';
                        echo '<div>';
                            echo '<a href="foto_album.php?'.$user.'">Photos</a>';
                        echo '</div>';

                        if ($login){
                            if ($user == $_SESSION['username']){
                                echo '<div>';
                                echo '    <a href="message.php?'.$user.'">Messages</a>';
                                echo '</div>';
                            }
                        }
                    ?>
                </div>